﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ASKM.Rachao.Model.Facade
{
    public class Site: BaseFacade
    {
        
        /// <summary>
        /// Returns a list of enabled sportactivities
        /// </summary>
        /// <returns>SportActivity[]</returns>
        public IList<SportActivity> GetSportActivity()
        {
            var query = from x in this.CtxRachao.SportActivity
                        where x.Enabled
                        orderby x.Position, x.Name
                        select x;

            return query.ToList();
        }

        /// <summary>
        /// Returns a list of enabled range time
        /// </summary>
        /// <returns>RangeTime[]</returns>
        public IList<RangeTime> GetRangeTime()
        {
            var query = from x in this.CtxRachao.RangeTime
                        where x.Enabled
                        orderby x.Label
                        select x;

            return query.ToList();
        }

        /// <summary>
        /// Returns a list of enabled region gaming
        /// </summary>
        /// <returns>RegionGaming[]</returns>
        public IList<RegionGaming> GetRegionGaming()
        {
            var query = from x in this.CtxRachao.RegionGaming.Include("City")                        
                        where x.Enabled
                        orderby x.Name
                        select x;

            return query.ToList();
        }

        /// <summary>
        /// Returns a list of weekdays names
        /// </summary>
        /// <returns>String[]</returns>
        public IList<String> GetWeekDays()
        {            
            var query = from x in System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.DayNames
                        select System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(x);
            return query.ToList();                      
        }

    }
}
